Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

pngconf.h

Go to the documentation of this file.
00001 
00002 /* pngconf.h - machine configurable file for libpng
00003  *
00004  * libpng version 1.2.7 - September 12, 2004
00005  * For conditions of distribution and use, see copyright notice in png.h
00006  * Copyright (c) 1998-2004 Glenn Randers-Pehrson
00007  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
00008  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
00009  */
00010 
00011 /* Any machine specific code is near the front of this file, so if you
00012  * are configuring libpng for a machine, you may want to read the section
00013  * starting here down to where it starts to typedef png_color, png_text,
00014  * and png_info.
00015  */
00016 
00017 #ifndef PNGCONF_H
00018 #define PNGCONF_H
00019 
00020 #ifdef PNG_USER_CONFIG
00021 #include "pngusr.h"
00022 #endif
00023 
00024 /* This is the size of the compression buffer, and thus the size of
00025  * an IDAT chunk.  Make this whatever size you feel is best for your
00026  * machine.  One of these will be allocated per png_struct.  When this
00027  * is full, it writes the data to the disk, and does some other
00028  * calculations.  Making this an extremely small size will slow
00029  * the library down, but you may want to experiment to determine
00030  * where it becomes significant, if you are concerned with memory
00031  * usage.  Note that zlib allocates at least 32Kb also.  For readers,
00032  * this describes the size of the buffer available to read the data in.
00033  * Unless this gets smaller than the size of a row (compressed),
00034  * it should not make much difference how big this is.
00035  */
00036 
00037 #ifndef PNG_ZBUF_SIZE
00038 #  define PNG_ZBUF_SIZE 8192
00039 #endif
00040 
00041 /* Enable if you want a write-only libpng */
00042 
00043 #ifndef PNG_NO_READ_SUPPORTED
00044 #  define PNG_READ_SUPPORTED
00045 #endif
00046 
00047 /* Enable if you want a read-only libpng */
00048 
00049 #ifndef PNG_NO_WRITE_SUPPORTED
00050 #  define PNG_WRITE_SUPPORTED
00051 #endif
00052 
00053 /* Enabled by default in 1.2.0.  You can disable this if you don't need to
00054    support PNGs that are embedded in MNG datastreams */
00055 #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
00056 #  ifndef PNG_MNG_FEATURES_SUPPORTED
00057 #    define PNG_MNG_FEATURES_SUPPORTED
00058 #  endif
00059 #endif
00060 
00061 #ifndef PNG_NO_FLOATING_POINT_SUPPORTED
00062 #  ifndef PNG_FLOATING_POINT_SUPPORTED
00063 #    define PNG_FLOATING_POINT_SUPPORTED
00064 #  endif
00065 #endif
00066 
00067 /* If you are running on a machine where you cannot allocate more
00068  * than 64K of memory at once, uncomment this.  While libpng will not
00069  * normally need that much memory in a chunk (unless you load up a very
00070  * large file), zlib needs to know how big of a chunk it can use, and
00071  * libpng thus makes sure to check any memory allocation to verify it
00072  * will fit into memory.
00073 #define PNG_MAX_MALLOC_64K
00074  */
00075 #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
00076 #  define PNG_MAX_MALLOC_64K
00077 #endif
00078 
00079 /* Special munging to support doing things the 'cygwin' way:
00080  * 'Normal' png-on-win32 defines/defaults:
00081  *   PNG_BUILD_DLL -- building dll
00082  *   PNG_USE_DLL   -- building an application, linking to dll
00083  *   (no define)   -- building static library, or building an
00084  *                    application and linking to the static lib
00085  * 'Cygwin' defines/defaults:
00086  *   PNG_BUILD_DLL -- (ignored) building the dll
00087  *   (no define)   -- (ignored) building an application, linking to the dll
00088  *   PNG_STATIC    -- (ignored) building the static lib, or building an 
00089  *                    application that links to the static lib.
00090  *   ALL_STATIC    -- (ignored) building various static libs, or building an 
00091  *                    application that links to the static libs.
00092  * Thus,
00093  * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
00094  * this bit of #ifdefs will define the 'correct' config variables based on
00095  * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but
00096  * unnecessary.
00097  *
00098  * Also, the precedence order is:
00099  *   ALL_STATIC (since we can't #undef something outside our namespace)
00100  *   PNG_BUILD_DLL
00101  *   PNG_STATIC
00102  *   (nothing) == PNG_USE_DLL
00103  * 
00104  * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
00105  *   of auto-import in binutils, we no longer need to worry about 
00106  *   __declspec(dllexport) / __declspec(dllimport) and friends.  Therefore,
00107  *   we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
00108  *   to __declspec() stuff.  However, we DO need to worry about 
00109  *   PNG_BUILD_DLL and PNG_STATIC because those change some defaults
00110  *   such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
00111  */
00112 #if defined(__CYGWIN__)
00113 #  if defined(ALL_STATIC)
00114 #    if defined(PNG_BUILD_DLL)
00115 #      undef PNG_BUILD_DLL
00116 #    endif
00117 #    if defined(PNG_USE_DLL)
00118 #      undef PNG_USE_DLL
00119 #    endif
00120 #    if defined(PNG_DLL)
00121 #      undef PNG_DLL
00122 #    endif
00123 #    if !defined(PNG_STATIC)
00124 #      define PNG_STATIC
00125 #    endif
00126 #  else
00127 #    if defined (PNG_BUILD_DLL)
00128 #      if defined(PNG_STATIC)
00129 #        undef PNG_STATIC
00130 #      endif
00131 #      if defined(PNG_USE_DLL)
00132 #        undef PNG_USE_DLL
00133 #      endif
00134 #      if !defined(PNG_DLL)
00135 #        define PNG_DLL
00136 #      endif
00137 #    else
00138 #      if defined(PNG_STATIC)
00139 #        if defined(PNG_USE_DLL)
00140 #          undef PNG_USE_DLL
00141 #        endif
00142 #        if defined(PNG_DLL)
00143 #          undef PNG_DLL
00144 #        endif
00145 #      else
00146 #        if !defined(PNG_USE_DLL)
00147 #          define PNG_USE_DLL
00148 #        endif
00149 #        if !defined(PNG_DLL)
00150 #          define PNG_DLL
00151 #        endif
00152 #      endif  
00153 #    endif  
00154 #  endif
00155 #endif
00156 
00157 /* This protects us against compilers that run on a windowing system
00158  * and thus don't have or would rather us not use the stdio types:
00159  * stdin, stdout, and stderr.  The only one currently used is stderr
00160  * in png_error() and png_warning().  #defining PNG_NO_CONSOLE_IO will
00161  * prevent these from being compiled and used. #defining PNG_NO_STDIO
00162  * will also prevent these, plus will prevent the entire set of stdio
00163  * macros and functions (FILE *, printf, etc.) from being compiled and used,
00164  * unless (PNG_DEBUG > 0) has been #defined.
00165  *
00166  * #define PNG_NO_CONSOLE_IO
00167  * #define PNG_NO_STDIO
00168  */
00169 
00170 #if defined(_WIN32_WCE)
00171 #  include <windows.h>
00172    /* Console I/O functions are not supported on WindowsCE */
00173 #  define PNG_NO_CONSOLE_IO
00174 #  ifdef PNG_DEBUG
00175 #    undef PNG_DEBUG
00176 #  endif
00177 #endif
00178 
00179 #ifdef PNG_BUILD_DLL
00180 #  ifndef PNG_CONSOLE_IO_SUPPORTED
00181 #    ifndef PNG_NO_CONSOLE_IO
00182 #      define PNG_NO_CONSOLE_IO
00183 #    endif
00184 #  endif
00185 #endif
00186 
00187 #  ifdef PNG_NO_STDIO
00188 #    ifndef PNG_NO_CONSOLE_IO
00189 #      define PNG_NO_CONSOLE_IO
00190 #    endif
00191 #    ifdef PNG_DEBUG
00192 #      if (PNG_DEBUG > 0)
00193 #        include <stdio.h>
00194 #      endif
00195 #    endif
00196 #  else
00197 #    if !defined(_WIN32_WCE)
00198 /* "stdio.h" functions are not supported on WindowsCE */
00199 #      include <stdio.h>
00200 #    endif
00201 #  endif
00202 
00203 /* This macro protects us against machines that don't have function
00204  * prototypes (ie K&R style headers).  If your compiler does not handle
00205  * function prototypes, define this macro and use the included ansi2knr.
00206  * I've always been able to use _NO_PROTO as the indicator, but you may
00207  * need to drag the empty declaration out in front of here, or change the
00208  * ifdef to suit your own needs.
00209  */
00210 #ifndef PNGARG
00211 
00212 #ifdef OF /* zlib prototype munger */
00213 #  define PNGARG(arglist) OF(arglist)
00214 #else
00215 
00216 #ifdef _NO_PROTO
00217 #  define PNGARG(arglist) ()
00218 #  ifndef PNG_TYPECAST_NULL
00219 #     define PNG_TYPECAST_NULL
00220 #  endif
00221 #else
00222 #  define PNGARG(arglist) arglist
00223 #endif /* _NO_PROTO */
00224 
00225 #endif /* OF */
00226 
00227 #endif /* PNGARG */
00228 
00229 /* Try to determine if we are compiling on a Mac.  Note that testing for
00230  * just __MWERKS__ is not good enough, because the Codewarrior is now used
00231  * on non-Mac platforms.
00232  */
00233 #ifndef MACOS
00234 #  if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
00235       defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
00236 #    define MACOS
00237 #  endif
00238 #endif
00239 
00240 /* enough people need this for various reasons to include it here */
00241 #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE)
00242 #  include <sys/types.h>
00243 #endif
00244 
00245 #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
00246 #  define PNG_SETJMP_SUPPORTED
00247 #endif
00248 
00249 #ifdef PNG_SETJMP_SUPPORTED
00250 /* This is an attempt to force a single setjmp behaviour on Linux.  If
00251  * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
00252  */
00253 
00254 #  ifdef __linux__
00255 #    ifdef _BSD_SOURCE
00256 #      define PNG_SAVE_BSD_SOURCE
00257 #      undef _BSD_SOURCE
00258 #    endif
00259 #    ifdef _SETJMP_H
00260      /* If you encounter a compiler error here, see the explanation
00261       * near the end of INSTALL.
00262       */
00263          __png.h__ already includes setjmp.h;
00264          __dont__ include it again.;
00265 #    endif
00266 #  endif /* __linux__ */
00267 
00268    /* include setjmp.h for error handling */
00269 #  include <setjmp.h>
00270 
00271 #  ifdef __linux__
00272 #    ifdef PNG_SAVE_BSD_SOURCE
00273 #      define _BSD_SOURCE
00274 #      undef PNG_SAVE_BSD_SOURCE
00275 #    endif
00276 #  endif /* __linux__ */
00277 #endif /* PNG_SETJMP_SUPPORTED */
00278 
00279 #ifdef BSD
00280 #  include <strings.h>
00281 #else
00282 #  include <string.h>
00283 #endif
00284 
00285 /* Other defines for things like memory and the like can go here.  */
00286 #ifdef PNG_INTERNAL
00287 
00288 #include <stdlib.h>
00289 
00290 /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
00291  * aren't usually used outside the library (as far as I know), so it is
00292  * debatable if they should be exported at all.  In the future, when it is
00293  * possible to have run-time registry of chunk-handling functions, some of
00294  * these will be made available again.
00295 #define PNG_EXTERN extern
00296  */
00297 #define PNG_EXTERN
00298 
00299 /* Other defines specific to compilers can go here.  Try to keep
00300  * them inside an appropriate ifdef/endif pair for portability.
00301  */
00302 
00303 #if defined(PNG_FLOATING_POINT_SUPPORTED)
00304 #  if defined(MACOS)
00305      /* We need to check that <math.h> hasn't already been included earlier
00306       * as it seems it doesn't agree with <fp.h>, yet we should really use
00307       * <fp.h> if possible.
00308       */
00309 #    if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
00310 #      include <fp.h>
00311 #    endif
00312 #  else
00313 #    include <math.h>
00314 #  endif
00315 #  if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
00316      /* Amiga SAS/C: We must include builtin FPU functions when compiling using
00317       * MATH=68881
00318       */
00319 #    include <m68881.h>
00320 #  endif
00321 #endif
00322 
00323 /* Codewarrior on NT has linking problems without this. */
00324 #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
00325 #  define PNG_ALWAYS_EXTERN
00326 #endif
00327 
00328 /* This provides the non-ANSI (far) memory allocation routines. */
00329 #if defined(__TURBOC__) && defined(__MSDOS__)
00330 #  include <mem.h>
00331 #  include <alloc.h>
00332 #endif
00333 
00334 /* I have no idea why is this necessary... */
00335 #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
00336     defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
00337 #  include <malloc.h>
00338 #endif
00339 
00340 /* This controls how fine the dithering gets.  As this allocates
00341  * a largish chunk of memory (32K), those who are not as concerned
00342  * with dithering quality can decrease some or all of these.
00343  */
00344 #ifndef PNG_DITHER_RED_BITS
00345 #  define PNG_DITHER_RED_BITS 5
00346 #endif
00347 #ifndef PNG_DITHER_GREEN_BITS
00348 #  define PNG_DITHER_GREEN_BITS 5
00349 #endif
00350 #ifndef PNG_DITHER_BLUE_BITS
00351 #  define PNG_DITHER_BLUE_BITS 5
00352 #endif
00353 
00354 /* This controls how fine the gamma correction becomes when you
00355  * are only interested in 8 bits anyway.  Increasing this value
00356  * results in more memory being used, and more pow() functions
00357  * being called to fill in the gamma tables.  Don't set this value
00358  * less then 8, and even that may not work (I haven't tested it).
00359  */
00360 
00361 #ifndef PNG_MAX_GAMMA_8
00362 #  define PNG_MAX_GAMMA_8 11
00363 #endif
00364 
00365 /* This controls how much a difference in gamma we can tolerate before
00366  * we actually start doing gamma conversion.
00367  */
00368 #ifndef PNG_GAMMA_THRESHOLD
00369 #  define PNG_GAMMA_THRESHOLD 0.05
00370 #endif
00371 
00372 #endif /* PNG_INTERNAL */
00373 
00374 /* The following uses const char * instead of char * for error
00375  * and warning message functions, so some compilers won't complain.
00376  * If you do not want to use const, define PNG_NO_CONST here.
00377  */
00378 
00379 #ifndef PNG_NO_CONST
00380 #  define PNG_CONST const
00381 #else
00382 #  define PNG_CONST
00383 #endif
00384 
00385 /* The following defines give you the ability to remove code from the
00386  * library that you will not be using.  I wish I could figure out how to
00387  * automate this, but I can't do that without making it seriously hard
00388  * on the users.  So if you are not using an ability, change the #define
00389  * to and #undef, and that part of the library will not be compiled.  If
00390  * your linker can't find a function, you may want to make sure the
00391  * ability is defined here.  Some of these depend upon some others being
00392  * defined.  I haven't figured out all the interactions here, so you may
00393  * have to experiment awhile to get everything to compile.  If you are
00394  * creating or using a shared library, you probably shouldn't touch this,
00395  * as it will affect the size of the structures, and this will cause bad
00396  * things to happen if the library and/or application ever change.
00397  */
00398 
00399 /* Any features you will not be using can be undef'ed here */
00400 
00401 /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
00402  * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
00403  * on the compile line, then pick and choose which ones to define without
00404  * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
00405  * if you only want to have a png-compliant reader/writer but don't need
00406  * any of the extra transformations.  This saves about 80 kbytes in a
00407  * typical installation of the library. (PNG_NO_* form added in version
00408  * 1.0.1c, for consistency)
00409  */
00410 
00411 /* The size of the png_text structure changed in libpng-1.0.6 when
00412  * iTXt is supported.  It is turned off by default, to support old apps
00413  * that malloc the png_text structure instead of calling png_set_text()
00414  * and letting libpng malloc it.  It will be turned on by default in
00415  * libpng-1.3.0.
00416  */
00417 
00418 #ifndef PNG_iTXt_SUPPORTED
00419 #  if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
00420 #    define PNG_NO_READ_iTXt
00421 #  endif
00422 #  if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
00423 #    define PNG_NO_WRITE_iTXt
00424 #  endif
00425 #endif
00426 
00427 /* The following support, added after version 1.0.0, can be turned off here en
00428  * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
00429  * with old applications that require the length of png_struct and png_info
00430  * to remain unchanged.
00431  */
00432 
00433 #ifdef PNG_LEGACY_SUPPORTED
00434 #  define PNG_NO_FREE_ME
00435 #  define PNG_NO_READ_UNKNOWN_CHUNKS
00436 #  define PNG_NO_WRITE_UNKNOWN_CHUNKS
00437 #  define PNG_NO_READ_USER_CHUNKS
00438 #  define PNG_NO_READ_iCCP
00439 #  define PNG_NO_WRITE_iCCP
00440 #  define PNG_NO_READ_iTXt
00441 #  define PNG_NO_WRITE_iTXt
00442 #  define PNG_NO_READ_sCAL
00443 #  define PNG_NO_WRITE_sCAL
00444 #  define PNG_NO_READ_sPLT
00445 #  define PNG_NO_WRITE_sPLT
00446 #  define PNG_NO_INFO_IMAGE
00447 #  define PNG_NO_READ_RGB_TO_GRAY
00448 #  define PNG_NO_READ_USER_TRANSFORM
00449 #  define PNG_NO_WRITE_USER_TRANSFORM
00450 #  define PNG_NO_USER_MEM
00451 #  define PNG_NO_READ_EMPTY_PLTE
00452 #  define PNG_NO_MNG_FEATURES
00453 #  define PNG_NO_FIXED_POINT_SUPPORTED
00454 #endif
00455 
00456 /* Ignore attempt to turn off both floating and fixed point support */
00457 #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
00458     !defined(PNG_NO_FIXED_POINT_SUPPORTED)
00459 #  define PNG_FIXED_POINT_SUPPORTED
00460 #endif
00461 
00462 #ifndef PNG_NO_FREE_ME
00463 #  define PNG_FREE_ME_SUPPORTED
00464 #endif
00465 
00466 #if defined(PNG_READ_SUPPORTED)
00467 
00468 #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
00469       !defined(PNG_NO_READ_TRANSFORMS)
00470 #  define PNG_READ_TRANSFORMS_SUPPORTED
00471 #endif
00472 
00473 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
00474 #  ifndef PNG_NO_READ_EXPAND
00475 #    define PNG_READ_EXPAND_SUPPORTED
00476 #  endif
00477 #  ifndef PNG_NO_READ_SHIFT
00478 #    define PNG_READ_SHIFT_SUPPORTED
00479 #  endif
00480 #  ifndef PNG_NO_READ_PACK
00481 #    define PNG_READ_PACK_SUPPORTED
00482 #  endif
00483 #  ifndef PNG_NO_READ_BGR
00484 #    define PNG_READ_BGR_SUPPORTED
00485 #  endif
00486 #  ifndef PNG_NO_READ_SWAP
00487 #    define PNG_READ_SWAP_SUPPORTED
00488 #  endif
00489 #  ifndef PNG_NO_READ_PACKSWAP
00490 #    define PNG_READ_PACKSWAP_SUPPORTED
00491 #  endif
00492 #  ifndef PNG_NO_READ_INVERT
00493 #    define PNG_READ_INVERT_SUPPORTED
00494 #  endif
00495 #  ifndef PNG_NO_READ_DITHER
00496 #    define PNG_READ_DITHER_SUPPORTED
00497 #  endif
00498 #  ifndef PNG_NO_READ_BACKGROUND
00499 #    define PNG_READ_BACKGROUND_SUPPORTED
00500 #  endif
00501 #  ifndef PNG_NO_READ_16_TO_8
00502 #    define PNG_READ_16_TO_8_SUPPORTED
00503 #  endif
00504 #  ifndef PNG_NO_READ_FILLER
00505 #    define PNG_READ_FILLER_SUPPORTED
00506 #  endif
00507 #  ifndef PNG_NO_READ_GAMMA
00508 #    define PNG_READ_GAMMA_SUPPORTED
00509 #  endif
00510 #  ifndef PNG_NO_READ_GRAY_TO_RGB
00511 #    define PNG_READ_GRAY_TO_RGB_SUPPORTED
00512 #  endif
00513 #  ifndef PNG_NO_READ_SWAP_ALPHA
00514 #    define PNG_READ_SWAP_ALPHA_SUPPORTED
00515 #  endif
00516 #  ifndef PNG_NO_READ_INVERT_ALPHA
00517 #    define PNG_READ_INVERT_ALPHA_SUPPORTED
00518 #  endif
00519 #  ifndef PNG_NO_READ_STRIP_ALPHA
00520 #    define PNG_READ_STRIP_ALPHA_SUPPORTED
00521 #  endif
00522 #  ifndef PNG_NO_READ_USER_TRANSFORM
00523 #    define PNG_READ_USER_TRANSFORM_SUPPORTED
00524 #  endif
00525 #  ifndef PNG_NO_READ_RGB_TO_GRAY
00526 #    define PNG_READ_RGB_TO_GRAY_SUPPORTED
00527 #  endif
00528 #endif /* PNG_READ_TRANSFORMS_SUPPORTED */
00529 
00530 #if !defined(PNG_NO_PROGRESSIVE_READ) && \
00531  !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED)  /* if you don't do progressive */
00532 #  define PNG_PROGRESSIVE_READ_SUPPORTED     /* reading.  This is not talking */
00533 #endif                               /* about interlacing capability!  You'll */
00534               /* still have interlacing unless you change the following line: */
00535 
00536 #define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */
00537 
00538 #ifndef PNG_NO_READ_COMPOSITE_NODIV
00539 #  ifndef PNG_NO_READ_COMPOSITED_NODIV  /* libpng-1.0.x misspelling */
00540 #    define PNG_READ_COMPOSITE_NODIV_SUPPORTED   /* well tested on Intel, SGI */
00541 #  endif
00542 #endif
00543 
00544 /* Deprecated, will be removed from version 2.0.0.
00545    Use PNG_MNG_FEATURES_SUPPORTED instead. */
00546 #ifndef PNG_NO_READ_EMPTY_PLTE
00547 #  define PNG_READ_EMPTY_PLTE_SUPPORTED
00548 #endif
00549 
00550 #endif /* PNG_READ_SUPPORTED */
00551 
00552 #if defined(PNG_WRITE_SUPPORTED)
00553 
00554 # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
00555     !defined(PNG_NO_WRITE_TRANSFORMS)
00556 #  define PNG_WRITE_TRANSFORMS_SUPPORTED
00557 #endif
00558 
00559 #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
00560 #  ifndef PNG_NO_WRITE_SHIFT
00561 #    define PNG_WRITE_SHIFT_SUPPORTED
00562 #  endif
00563 #  ifndef PNG_NO_WRITE_PACK
00564 #    define PNG_WRITE_PACK_SUPPORTED
00565 #  endif
00566 #  ifndef PNG_NO_WRITE_BGR
00567 #    define PNG_WRITE_BGR_SUPPORTED
00568 #  endif
00569 #  ifndef PNG_NO_WRITE_SWAP
00570 #    define PNG_WRITE_SWAP_SUPPORTED
00571 #  endif
00572 #  ifndef PNG_NO_WRITE_PACKSWAP
00573 #    define PNG_WRITE_PACKSWAP_SUPPORTED
00574 #  endif
00575 #  ifndef PNG_NO_WRITE_INVERT
00576 #    define PNG_WRITE_INVERT_SUPPORTED
00577 #  endif
00578 #  ifndef PNG_NO_WRITE_FILLER
00579 #    define PNG_WRITE_FILLER_SUPPORTED   /* same as WRITE_STRIP_ALPHA */
00580 #  endif
00581 #  ifndef PNG_NO_WRITE_SWAP_ALPHA
00582 #    define PNG_WRITE_SWAP_ALPHA_SUPPORTED
00583 #  endif
00584 #  ifndef PNG_NO_WRITE_INVERT_ALPHA
00585 #    define PNG_WRITE_INVERT_ALPHA_SUPPORTED
00586 #  endif
00587 #  ifndef PNG_NO_WRITE_USER_TRANSFORM
00588 #    define PNG_WRITE_USER_TRANSFORM_SUPPORTED
00589 #  endif
00590 #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
00591 
00592 #define PNG_WRITE_INTERLACING_SUPPORTED  /* not required for PNG-compliant
00593                                             encoders, but can cause trouble
00594                                             if left undefined */
00595 
00596 #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
00597      defined(PNG_FLOATING_POINT_SUPPORTED)
00598 #  define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
00599 #endif
00600 
00601 #ifndef PNG_NO_WRITE_FLUSH
00602 #  define PNG_WRITE_FLUSH_SUPPORTED
00603 #endif
00604 
00605 /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */
00606 #ifndef PNG_NO_WRITE_EMPTY_PLTE
00607 #  define PNG_WRITE_EMPTY_PLTE_SUPPORTED
00608 #endif
00609 
00610 #endif /* PNG_WRITE_SUPPORTED */
00611 
00612 #ifndef PNG_1_0_X
00613 #  ifndef PNG_NO_ERROR_NUMBERS
00614 #    define PNG_ERROR_NUMBERS_SUPPORTED
00615 #  endif
00616 #endif /* PNG_1_0_X */
00617 
00618 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
00619     defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
00620 #  ifndef PNG_NO_USER_TRANSFORM_PTR
00621 #    define PNG_USER_TRANSFORM_PTR_SUPPORTED
00622 #  endif
00623 #endif
00624 
00625 #ifndef PNG_NO_STDIO
00626 #  define PNG_TIME_RFC1123_SUPPORTED
00627 #endif
00628 
00629 /* This adds extra functions in pngget.c for accessing data from the
00630  * info pointer (added in version 0.99)
00631  * png_get_image_width()
00632  * png_get_image_height()
00633  * png_get_bit_depth()
00634  * png_get_color_type()
00635  * png_get_compression_type()
00636  * png_get_filter_type()
00637  * png_get_interlace_type()
00638  * png_get_pixel_aspect_ratio()
00639  * png_get_pixels_per_meter()
00640  * png_get_x_offset_pixels()
00641  * png_get_y_offset_pixels()
00642  * png_get_x_offset_microns()
00643  * png_get_y_offset_microns()
00644  */
00645 #if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
00646 #  define PNG_EASY_ACCESS_SUPPORTED
00647 #endif
00648 
00649 /* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 
00650    even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined */
00651 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
00652 #  ifndef PNG_ASSEMBLER_CODE_SUPPORTED
00653 #    define PNG_ASSEMBLER_CODE_SUPPORTED
00654 #  endif
00655 #  if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
00656 #    define PNG_MMX_CODE_SUPPORTED
00657 #  endif
00658 #endif
00659 
00660 /* If you are sure that you don't need thread safety and you are compiling
00661    with PNG_USE_PNGCCRD for an MMX application, you can define this for
00662    faster execution.  See pnggccrd.c.
00663 #define PNG_THREAD_UNSAFE_OK
00664 */
00665 
00666 #if !defined(PNG_1_0_X)
00667 #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
00668 #  define PNG_USER_MEM_SUPPORTED
00669 #endif
00670 #endif /* PNG_1_0_X */
00671 
00672 /* Added at libpng-1.2.6 */
00673 #if !defined(PNG_1_0_X)
00674 #ifndef PNG_SET_USER_LIMITS_SUPPORTED
00675 #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
00676 #  define PNG_SET_USER_LIMITS_SUPPORTED
00677 #endif
00678 #endif
00679 #endif /* PNG_1_0_X */
00680 
00681 /* Added at libpng-1.0.16 and 1.2.6.  To accept all valid PNGS no matter
00682  * how large, set these limits to 0x7fffffffL
00683  */
00684 #ifndef PNG_USER_WIDTH_MAX
00685 #  define PNG_USER_WIDTH_MAX 1000000L
00686 #endif
00687 #ifndef PNG_USER_HEIGHT_MAX
00688 #  define PNG_USER_HEIGHT_MAX 1000000L
00689 #endif
00690 
00691 /* These are currently experimental features, define them if you want */
00692 
00693 /* very little testing */
00694 /*
00695 #ifdef PNG_READ_SUPPORTED
00696 #  ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
00697 #    define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
00698 #  endif
00699 #endif
00700 */
00701 
00702 /* This is only for PowerPC big-endian and 680x0 systems */
00703 /* some testing */
00704 /*
00705 #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
00706 #  define PNG_READ_BIG_ENDIAN_SUPPORTED
00707 #endif
00708 */
00709 
00710 /* Buggy compilers (e.g., gcc 2.7.2.2) need this */
00711 /*
00712 #define PNG_NO_POINTER_INDEXING
00713 */
00714 
00715 /* These functions are turned off by default, as they will be phased out. */
00716 /*
00717 #define  PNG_USELESS_TESTS_SUPPORTED
00718 #define  PNG_CORRECT_PALETTE_SUPPORTED
00719 */
00720 
00721 /* Any chunks you are not interested in, you can undef here.  The
00722  * ones that allocate memory may be expecially important (hIST,
00723  * tEXt, zTXt, tRNS, pCAL).  Others will just save time and make png_info
00724  * a bit smaller.
00725  */
00726 
00727 #if defined(PNG_READ_SUPPORTED) && \
00728     !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
00729     !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
00730 #  define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
00731 #endif
00732 
00733 #if defined(PNG_WRITE_SUPPORTED) && \
00734     !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
00735     !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
00736 #  define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
00737 #endif
00738 
00739 #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
00740 
00741 #ifdef PNG_NO_READ_TEXT
00742 #  define PNG_NO_READ_iTXt
00743 #  define PNG_NO_READ_tEXt
00744 #  define PNG_NO_READ_zTXt
00745 #endif
00746 #ifndef PNG_NO_READ_bKGD
00747 #  define PNG_READ_bKGD_SUPPORTED
00748 #  define PNG_bKGD_SUPPORTED
00749 #endif
00750 #ifndef PNG_NO_READ_cHRM
00751 #  define PNG_READ_cHRM_SUPPORTED
00752 #  define PNG_cHRM_SUPPORTED
00753 #endif
00754 #ifndef PNG_NO_READ_gAMA
00755 #  define PNG_READ_gAMA_SUPPORTED
00756 #  define PNG_gAMA_SUPPORTED
00757 #endif
00758 #ifndef PNG_NO_READ_hIST
00759 #  define PNG_READ_hIST_SUPPORTED
00760 #  define PNG_hIST_SUPPORTED
00761 #endif
00762 #ifndef PNG_NO_READ_iCCP
00763 #  define PNG_READ_iCCP_SUPPORTED
00764 #  define PNG_iCCP_SUPPORTED
00765 #endif
00766 #ifndef PNG_NO_READ_iTXt
00767 #  ifndef PNG_READ_iTXt_SUPPORTED
00768 #    define PNG_READ_iTXt_SUPPORTED
00769 #  endif
00770 #  ifndef PNG_iTXt_SUPPORTED
00771 #    define PNG_iTXt_SUPPORTED
00772 #  endif
00773 #endif
00774 #ifndef PNG_NO_READ_oFFs
00775 #  define PNG_READ_oFFs_SUPPORTED
00776 #  define PNG_oFFs_SUPPORTED
00777 #endif
00778 #ifndef PNG_NO_READ_pCAL
00779 #  define PNG_READ_pCAL_SUPPORTED
00780 #  define PNG_pCAL_SUPPORTED
00781 #endif
00782 #ifndef PNG_NO_READ_sCAL
00783 #  define PNG_READ_sCAL_SUPPORTED
00784 #  define PNG_sCAL_SUPPORTED
00785 #endif
00786 #ifndef PNG_NO_READ_pHYs
00787 #  define PNG_READ_pHYs_SUPPORTED
00788 #  define PNG_pHYs_SUPPORTED
00789 #endif
00790 #ifndef PNG_NO_READ_sBIT
00791 #  define PNG_READ_sBIT_SUPPORTED
00792 #  define PNG_sBIT_SUPPORTED
00793 #endif
00794 #ifndef PNG_NO_READ_sPLT
00795 #  define PNG_READ_sPLT_SUPPORTED
00796 #  define PNG_sPLT_SUPPORTED
00797 #endif
00798 #ifndef PNG_NO_READ_sRGB
00799 #  define PNG_READ_sRGB_SUPPORTED
00800 #  define PNG_sRGB_SUPPORTED
00801 #endif
00802 #ifndef PNG_NO_READ_tEXt
00803 #  define PNG_READ_tEXt_SUPPORTED
00804 #  define PNG_tEXt_SUPPORTED
00805 #endif
00806 #ifndef PNG_NO_READ_tIME
00807 #  define PNG_READ_tIME_SUPPORTED
00808 #  define PNG_tIME_SUPPORTED
00809 #endif
00810 #ifndef PNG_NO_READ_tRNS
00811 #  define PNG_READ_tRNS_SUPPORTED
00812 #  define PNG_tRNS_SUPPORTED
00813 #endif
00814 #ifndef PNG_NO_READ_zTXt
00815 #  define PNG_READ_zTXt_SUPPORTED
00816 #  define PNG_zTXt_SUPPORTED
00817 #endif
00818 #ifndef PNG_NO_READ_UNKNOWN_CHUNKS
00819 #  define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
00820 #  ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
00821 #    define PNG_UNKNOWN_CHUNKS_SUPPORTED
00822 #  endif
00823 #  ifndef PNG_NO_HANDLE_AS_UNKNOWN
00824 #    define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
00825 #  endif
00826 #endif
00827 #if !defined(PNG_NO_READ_USER_CHUNKS) && \
00828      defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
00829 #  define PNG_READ_USER_CHUNKS_SUPPORTED
00830 #  define PNG_USER_CHUNKS_SUPPORTED
00831 #  ifdef PNG_NO_READ_UNKNOWN_CHUNKS
00832 #    undef PNG_NO_READ_UNKNOWN_CHUNKS
00833 #  endif
00834 #  ifdef PNG_NO_HANDLE_AS_UNKNOWN
00835 #    undef PNG_NO_HANDLE_AS_UNKNOWN
00836 #  endif
00837 #endif
00838 #ifndef PNG_NO_READ_OPT_PLTE
00839 #  define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */
00840 #endif                      /* optional PLTE chunk in RGB and RGBA images */
00841 #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
00842     defined(PNG_READ_zTXt_SUPPORTED)
00843 #  define PNG_READ_TEXT_SUPPORTED
00844 #  define PNG_TEXT_SUPPORTED
00845 #endif
00846 
00847 #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
00848 
00849 #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
00850 
00851 #ifdef PNG_NO_WRITE_TEXT
00852 #  define PNG_NO_WRITE_iTXt
00853 #  define PNG_NO_WRITE_tEXt
00854 #  define PNG_NO_WRITE_zTXt
00855 #endif
00856 #ifndef PNG_NO_WRITE_bKGD
00857 #  define PNG_WRITE_bKGD_SUPPORTED
00858 #  ifndef PNG_bKGD_SUPPORTED
00859 #    define PNG_bKGD_SUPPORTED
00860 #  endif
00861 #endif
00862 #ifndef PNG_NO_WRITE_cHRM
00863 #  define PNG_WRITE_cHRM_SUPPORTED
00864 #  ifndef PNG_cHRM_SUPPORTED
00865 #    define PNG_cHRM_SUPPORTED
00866 #  endif
00867 #endif
00868 #ifndef PNG_NO_WRITE_gAMA
00869 #  define PNG_WRITE_gAMA_SUPPORTED
00870 #  ifndef PNG_gAMA_SUPPORTED
00871 #    define PNG_gAMA_SUPPORTED
00872 #  endif
00873 #endif
00874 #ifndef PNG_NO_WRITE_hIST
00875 #  define PNG_WRITE_hIST_SUPPORTED
00876 #  ifndef PNG_hIST_SUPPORTED
00877 #    define PNG_hIST_SUPPORTED
00878 #  endif
00879 #endif
00880 #ifndef PNG_NO_WRITE_iCCP
00881 #  define PNG_WRITE_iCCP_SUPPORTED
00882 #  ifndef PNG_iCCP_SUPPORTED
00883 #    define PNG_iCCP_SUPPORTED
00884 #  endif
00885 #endif
00886 #ifndef PNG_NO_WRITE_iTXt
00887 #  ifndef PNG_WRITE_iTXt_SUPPORTED
00888 #    define PNG_WRITE_iTXt_SUPPORTED
00889 #  endif
00890 #  ifndef PNG_iTXt_SUPPORTED
00891 #    define PNG_iTXt_SUPPORTED
00892 #  endif
00893 #endif
00894 #ifndef PNG_NO_WRITE_oFFs
00895 #  define PNG_WRITE_oFFs_SUPPORTED
00896 #  ifndef PNG_oFFs_SUPPORTED
00897 #    define PNG_oFFs_SUPPORTED
00898 #  endif
00899 #endif
00900 #ifndef PNG_NO_WRITE_pCAL
00901 #  define PNG_WRITE_pCAL_SUPPORTED
00902 #  ifndef PNG_pCAL_SUPPORTED
00903 #    define PNG_pCAL_SUPPORTED
00904 #  endif
00905 #endif
00906 #ifndef PNG_NO_WRITE_sCAL
00907 #  define PNG_WRITE_sCAL_SUPPORTED
00908 #  ifndef PNG_sCAL_SUPPORTED
00909 #    define PNG_sCAL_SUPPORTED
00910 #  endif
00911 #endif
00912 #ifndef PNG_NO_WRITE_pHYs
00913 #  define PNG_WRITE_pHYs_SUPPORTED
00914 #  ifndef PNG_pHYs_SUPPORTED
00915 #    define PNG_pHYs_SUPPORTED
00916 #  endif
00917 #endif
00918 #ifndef PNG_NO_WRITE_sBIT
00919 #  define PNG_WRITE_sBIT_SUPPORTED
00920 #  ifndef PNG_sBIT_SUPPORTED
00921 #    define PNG_sBIT_SUPPORTED
00922 #  endif
00923 #endif
00924 #ifndef PNG_NO_WRITE_sPLT
00925 #  define PNG_WRITE_sPLT_SUPPORTED
00926 #  ifndef PNG_sPLT_SUPPORTED
00927 #    define PNG_sPLT_SUPPORTED
00928 #  endif
00929 #endif
00930 #ifndef PNG_NO_WRITE_sRGB
00931 #  define PNG_WRITE_sRGB_SUPPORTED
00932 #  ifndef PNG_sRGB_SUPPORTED
00933 #    define PNG_sRGB_SUPPORTED
00934 #  endif
00935 #endif
00936 #ifndef PNG_NO_WRITE_tEXt
00937 #  define PNG_WRITE_tEXt_SUPPORTED
00938 #  ifndef PNG_tEXt_SUPPORTED
00939 #    define PNG_tEXt_SUPPORTED
00940 #  endif
00941 #endif
00942 #ifndef PNG_NO_WRITE_tIME
00943 #  define PNG_WRITE_tIME_SUPPORTED
00944 #  ifndef PNG_tIME_SUPPORTED
00945 #    define PNG_tIME_SUPPORTED
00946 #  endif
00947 #endif
00948 #ifndef PNG_NO_WRITE_tRNS
00949 #  define PNG_WRITE_tRNS_SUPPORTED
00950 #  ifndef PNG_tRNS_SUPPORTED
00951 #    define PNG_tRNS_SUPPORTED
00952 #  endif
00953 #endif
00954 #ifndef PNG_NO_WRITE_zTXt
00955 #  define PNG_WRITE_zTXt_SUPPORTED
00956 #  ifndef PNG_zTXt_SUPPORTED
00957 #    define PNG_zTXt_SUPPORTED
00958 #  endif
00959 #endif
00960 #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
00961 #  define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
00962 #  ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
00963 #    define PNG_UNKNOWN_CHUNKS_SUPPORTED
00964 #  endif
00965 #  ifndef PNG_NO_HANDLE_AS_UNKNOWN
00966 #     ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
00967 #       define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
00968 #     endif
00969 #  endif
00970 #endif
00971 #if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
00972     defined(PNG_WRITE_zTXt_SUPPORTED)
00973 #  define PNG_WRITE_TEXT_SUPPORTED
00974 #  ifndef PNG_TEXT_SUPPORTED
00975 #    define PNG_TEXT_SUPPORTED
00976 #  endif
00977 #endif
00978 
00979 #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
00980 
00981 /* Turn this off to disable png_read_png() and
00982  * png_write_png() and leave the row_pointers member
00983  * out of the info structure.
00984  */
00985 #ifndef PNG_NO_INFO_IMAGE
00986 #  define PNG_INFO_IMAGE_SUPPORTED
00987 #endif
00988 
00989 /* need the time information for reading tIME chunks */
00990 #if defined(PNG_tIME_SUPPORTED)
00991 #  if !defined(_WIN32_WCE)
00992      /* "time.h" functions are not supported on WindowsCE */
00993 #    include <time.h>
00994 #  endif
00995 #endif
00996 
00997 /* Some typedefs to get us started.  These should be safe on most of the
00998  * common platforms.  The typedefs should be at least as large as the
00999  * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
01000  * don't have to be exactly that size.  Some compilers dislike passing
01001  * unsigned shorts as function parameters, so you may be better off using
01002  * unsigned int for png_uint_16.  Likewise, for 64-bit systems, you may
01003  * want to have unsigned int for png_uint_32 instead of unsigned long.
01004  */
01005 
01006 typedef unsigned long png_uint_32;
01007 typedef long png_int_32;
01008 typedef unsigned short png_uint_16;
01009 typedef short png_int_16;
01010 typedef unsigned char png_byte;
01011 
01012 /* This is usually size_t.  It is typedef'ed just in case you need it to
01013    change (I'm not sure if you will or not, so I thought I'd be safe) */
01014 #ifdef PNG_SIZE_T
01015    typedef PNG_SIZE_T png_size_t;
01016 #  define png_sizeof(x) png_convert_size(sizeof (x))
01017 #else
01018    typedef size_t png_size_t;
01019 #  define png_sizeof(x) sizeof (x)
01020 #endif
01021 
01022 /* The following is needed for medium model support.  It cannot be in the
01023  * PNG_INTERNAL section.  Needs modification for other compilers besides
01024  * MSC.  Model independent support declares all arrays and pointers to be
01025  * large using the far keyword.  The zlib version used must also support
01026  * model independent data.  As of version zlib 1.0.4, the necessary changes
01027  * have been made in zlib.  The USE_FAR_KEYWORD define triggers other
01028  * changes that are needed. (Tim Wegner)
01029  */
01030 
01031 /* Separate compiler dependencies (problem here is that zlib.h always
01032    defines FAR. (SJT) */
01033 #ifdef __BORLANDC__
01034 #  if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
01035 #    define LDATA 1
01036 #  else
01037 #    define LDATA 0
01038 #  endif
01039    /* GRR:  why is Cygwin in here?  Cygwin is not Borland C... */
01040 #  if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
01041 #    define PNG_MAX_MALLOC_64K
01042 #    if (LDATA != 1)
01043 #      ifndef FAR
01044 #        define FAR __far
01045 #      endif
01046 #      define USE_FAR_KEYWORD
01047 #    endif   /* LDATA != 1 */
01048      /* Possibly useful for moving data out of default segment.
01049       * Uncomment it if you want. Could also define FARDATA as
01050       * const if your compiler supports it. (SJT)
01051 #    define FARDATA FAR
01052       */
01053 #  endif  /* __WIN32__, __FLAT__, __CYGWIN__ */
01054 #endif   /* __BORLANDC__ */
01055 
01056 
01057 /* Suggest testing for specific compiler first before testing for
01058  * FAR.  The Watcom compiler defines both __MEDIUM__ and M_I86MM,
01059  * making reliance oncertain keywords suspect. (SJT)
01060  */
01061 
01062 /* MSC Medium model */
01063 #if defined(FAR)
01064 #  if defined(M_I86MM)
01065 #    define USE_FAR_KEYWORD
01066 #    define FARDATA FAR
01067 #    include <dos.h>
01068 #  endif
01069 #endif
01070 
01071 /* SJT: default case */
01072 #ifndef FAR
01073 #  define FAR
01074 #endif
01075 
01076 /* At this point FAR is always defined */
01077 #ifndef FARDATA
01078 #  define FARDATA
01079 #endif
01080 
01081 /* Typedef for floating-point numbers that are converted
01082    to fixed-point with a multiple of 100,000, e.g., int_gamma */
01083 typedef png_int_32 png_fixed_point;
01084 
01085 /* Add typedefs for pointers */
01086 typedef void            FAR * png_voidp;
01087 typedef png_byte        FAR * png_bytep;
01088 typedef png_uint_32     FAR * png_uint_32p;
01089 typedef png_int_32      FAR * png_int_32p;
01090 typedef png_uint_16     FAR * png_uint_16p;
01091 typedef png_int_16      FAR * png_int_16p;
01092 typedef PNG_CONST char  FAR * png_const_charp;
01093 typedef char            FAR * png_charp;
01094 typedef png_fixed_point FAR * png_fixed_point_p;
01095 
01096 #ifndef PNG_NO_STDIO
01097 #if defined(_WIN32_WCE)
01098 typedef HANDLE                png_FILE_p;
01099 #else
01100 typedef FILE                * png_FILE_p;
01101 #endif
01102 #endif
01103 
01104 #ifdef PNG_FLOATING_POINT_SUPPORTED
01105 typedef double          FAR * png_doublep;
01106 #endif
01107 
01108 /* Pointers to pointers; i.e. arrays */
01109 typedef png_byte        FAR * FAR * png_bytepp;
01110 typedef png_uint_32     FAR * FAR * png_uint_32pp;
01111 typedef png_int_32      FAR * FAR * png_int_32pp;
01112 typedef png_uint_16     FAR * FAR * png_uint_16pp;
01113 typedef png_int_16      FAR * FAR * png_int_16pp;
01114 typedef PNG_CONST char  FAR * FAR * png_const_charpp;
01115 typedef char            FAR * FAR * png_charpp;
01116 typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
01117 #ifdef PNG_FLOATING_POINT_SUPPORTED
01118 typedef double          FAR * FAR * png_doublepp;
01119 #endif
01120 
01121 /* Pointers to pointers to pointers; i.e., pointer to array */
01122 typedef char            FAR * FAR * FAR * png_charppp;
01123 
01124 /* libpng typedefs for types in zlib. If zlib changes
01125  * or another compression library is used, then change these.
01126  * Eliminates need to change all the source files.
01127  */
01128 typedef charf *         png_zcharp;
01129 typedef charf * FAR *   png_zcharpp;
01130 typedef z_stream FAR *  png_zstreamp;
01131 
01132 /*
01133  * Define PNG_BUILD_DLL if the module being built is a Windows
01134  * LIBPNG DLL.
01135  *
01136  * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
01137  * It is equivalent to Microsoft predefined macro _DLL that is
01138  * automatically defined when you compile using the share
01139  * version of the CRT (C Run-Time library)
01140  *
01141  * The cygwin mods make this behavior a little different:
01142  * Define PNG_BUILD_DLL if you are building a dll for use with cygwin
01143  * Define PNG_STATIC if you are building a static library for use with cygwin,
01144  *   -or- if you are building an application that you want to link to the
01145  *   static library.
01146  * PNG_USE_DLL is defined by default (no user action needed) unless one of
01147  *   the other flags is defined.
01148  */
01149 
01150 #if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
01151 #  define PNG_DLL
01152 #endif
01153 /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib.
01154  * When building a static lib, default to no GLOBAL ARRAYS, but allow
01155  * command-line override
01156  */
01157 #if defined(__CYGWIN__)
01158 #  if !defined(PNG_STATIC)
01159 #    if defined(PNG_USE_GLOBAL_ARRAYS)
01160 #      undef PNG_USE_GLOBAL_ARRAYS
01161 #    endif
01162 #    if !defined(PNG_USE_LOCAL_ARRAYS)
01163 #      define PNG_USE_LOCAL_ARRAYS
01164 #    endif
01165 #  else
01166 #    if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS)
01167 #      if defined(PNG_USE_GLOBAL_ARRAYS)
01168 #        undef PNG_USE_GLOBAL_ARRAYS
01169 #      endif
01170 #    endif
01171 #  endif
01172 #  if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
01173 #    define PNG_USE_LOCAL_ARRAYS
01174 #  endif
01175 #endif
01176 
01177 /* Do not use global arrays (helps with building DLL's)
01178  * They are no longer used in libpng itself, since version 1.0.5c,
01179  * but might be required for some pre-1.0.5c applications.
01180  */
01181 #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
01182 #  if defined(PNG_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(PNG_DLL))
01183 #    define PNG_USE_LOCAL_ARRAYS
01184 #  else
01185 #    define PNG_USE_GLOBAL_ARRAYS
01186 #  endif
01187 #endif
01188 
01189 #if defined(__CYGWIN__)
01190 #  undef PNGAPI
01191 #  define PNGAPI __cdecl
01192 #  undef PNG_IMPEXP
01193 #  define PNG_IMPEXP
01194 #endif  
01195 
01196 /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
01197  * you may get warnings regarding the linkage of png_zalloc and png_zfree.
01198  * Don't ignore those warnings; you must also reset the default calling
01199  * convention in your compiler to match your PNGAPI, and you must build
01200  * zlib and your applications the same way you build libpng.
01201  */
01202 
01203 #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
01204 #  ifndef PNG_NO_MODULEDEF
01205 #    define PNG_NO_MODULEDEF
01206 #  endif
01207 #endif
01208 
01209 #if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
01210 #  define PNG_IMPEXP
01211 #endif
01212 
01213 #if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
01214     (( defined(_Windows) || defined(_WINDOWS) || \
01215        defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
01216 
01217 #  ifndef PNGAPI
01218 #     if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
01219 #        define PNGAPI __cdecl
01220 #     else
01221 #        define PNGAPI _cdecl
01222 #     endif
01223 #  endif
01224 
01225 #  if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
01226        0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
01227 #     define PNG_IMPEXP
01228 #  endif
01229 
01230 #  if !defined(PNG_IMPEXP)
01231 
01232 #     define PNG_EXPORT_TYPE1(type,symbol)  PNG_IMPEXP type PNGAPI symbol
01233 #     define PNG_EXPORT_TYPE2(type,symbol)  type PNG_IMPEXP PNGAPI symbol
01234 
01235       /* Borland/Microsoft */
01236 #     if defined(_MSC_VER) || defined(__BORLANDC__)
01237 #        if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
01238 #           define PNG_EXPORT PNG_EXPORT_TYPE1
01239 #        else
01240 #           define PNG_EXPORT PNG_EXPORT_TYPE2
01241 #           if defined(PNG_BUILD_DLL)
01242 #              define PNG_IMPEXP __export
01243 #           else
01244 #              define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
01245                                                  VC++ */
01246 #           endif                             /* Exists in Borland C++ for
01247                                                  C++ classes (== huge) */
01248 #        endif
01249 #     endif
01250 
01251 #     if !defined(PNG_IMPEXP)
01252 #        if defined(PNG_BUILD_DLL)
01253 #           define PNG_IMPEXP __declspec(dllexport)
01254 #        else
01255 #           define PNG_IMPEXP __declspec(dllimport)
01256 #        endif
01257 #     endif
01258 #  endif  /* PNG_IMPEXP */
01259 #else /* !(DLL || non-cygwin WINDOWS) */
01260 #   if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
01261 #      ifndef PNGAPI
01262 #         define PNGAPI _System
01263 #      endif
01264 #   else
01265 #      if 0 /* ... other platforms, with other meanings */
01266 #      endif
01267 #   endif
01268 #endif
01269 
01270 #ifndef PNGAPI
01271 #  define PNGAPI
01272 #endif
01273 #ifndef PNG_IMPEXP
01274 #  define PNG_IMPEXP
01275 #endif
01276 
01277 #ifndef PNG_EXPORT
01278 #  define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
01279 #endif
01280 
01281 #ifdef PNG_USE_GLOBAL_ARRAYS
01282 #  ifndef PNG_EXPORT_VAR
01283 #    define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
01284 #  endif
01285 #endif
01286 
01287 /* User may want to use these so they are not in PNG_INTERNAL. Any library
01288  * functions that are passed far data must be model independent.
01289  */
01290 
01291 #ifndef PNG_ABORT
01292 #  define PNG_ABORT() abort()
01293 #endif
01294 
01295 #ifdef PNG_SETJMP_SUPPORTED
01296 #  define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
01297 #else
01298 #  define png_jmpbuf(png_ptr) \
01299    (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
01300 #endif
01301 
01302 #if defined(USE_FAR_KEYWORD)  /* memory model independent fns */
01303 /* use this to make far-to-near assignments */
01304 #  define CHECK   1
01305 #  define NOCHECK 0
01306 #  define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
01307 #  define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
01308 #  define png_strcpy  _fstrcpy
01309 #  define png_strncpy _fstrncpy   /* Added to v 1.2.6 */
01310 #  define png_strlen  _fstrlen
01311 #  define png_memcmp  _fmemcmp    /* SJT: added */
01312 #  define png_memcpy  _fmemcpy
01313 #  define png_memset  _fmemset
01314 #else /* use the usual functions */
01315 #  define CVT_PTR(ptr)         (ptr)
01316 #  define CVT_PTR_NOCHECK(ptr) (ptr)
01317 #  define png_strcpy  strcpy
01318 #  define png_strncpy strncpy     /* Added to v 1.2.6 */
01319 #  define png_strlen  strlen
01320 #  define png_memcmp  memcmp      /* SJT: added */
01321 #  define png_memcpy  memcpy
01322 #  define png_memset  memset
01323 #endif
01324 /* End of memory model independent support */
01325 
01326 /* Just a little check that someone hasn't tried to define something
01327  * contradictory.
01328  */
01329 #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
01330 #  undef PNG_ZBUF_SIZE
01331 #  define PNG_ZBUF_SIZE 65536L
01332 #endif
01333 
01334 #ifdef PNG_READ_SUPPORTED
01335 /* Prior to libpng-1.0.9, this block was in pngasmrd.h */
01336 #if defined(PNG_INTERNAL)
01337 
01338 /* These are the default thresholds before the MMX code kicks in; if either
01339  * rowbytes or bitdepth is below the threshold, plain C code is used.  These
01340  * can be overridden at runtime via the png_set_mmx_thresholds() call in
01341  * libpng 1.2.0 and later.  The values below were chosen by Intel.
01342  */
01343 
01344 #ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT
01345 #  define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT  128  /*  >=  */
01346 #endif
01347 #ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT
01348 #  define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT  9    /*  >=  */   
01349 #endif
01350 
01351 /* Set this in the makefile for VC++ on Pentium, not here. */
01352 /* Platform must be Pentium.  Makefile must assemble and load pngvcrd.c .
01353  * MMX will be detected at run time and used if present.
01354  */
01355 #ifdef PNG_USE_PNGVCRD
01356 #  define PNG_HAVE_ASSEMBLER_COMBINE_ROW
01357 #  define PNG_HAVE_ASSEMBLER_READ_INTERLACE
01358 #  define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
01359 #endif
01360 
01361 /* Set this in the makefile for gcc/as on Pentium, not here. */
01362 /* Platform must be Pentium.  Makefile must assemble and load pnggccrd.c .
01363  * MMX will be detected at run time and used if present.
01364  */
01365 #ifdef PNG_USE_PNGGCCRD
01366 #  define PNG_HAVE_ASSEMBLER_COMBINE_ROW
01367 #  define PNG_HAVE_ASSEMBLER_READ_INTERLACE
01368 #  define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
01369 #endif
01370 /* - see pnggccrd.c for info about what is currently enabled */
01371 
01372 #endif /* PNG_INTERNAL */
01373 #endif /* PNG_READ_SUPPORTED */
01374 
01375 #endif /* PNGCONF_H */
01376 

Generated on Mon Sep 12 19:58:55 2005 for Destiny3D by doxygen1.3-rc3